package com.mysoft.disconf.dao.impl;

import org.springframework.stereotype.Repository;

import com.mysoft.disconf.dao.UserDao;
import com.mysoft.disconf.entity.User;
import com.mysoft.disconf.mybatis.BaseDao;

@Repository
public class UserDaoImpl extends BaseDao<User, Long> implements UserDao {
	
	private final String namespace = UserDaoImpl.class.getName();

	/**
	 * {@inheritDoc}
	 */
	public int inset(User user) {
		return insert(namespace + ".insert", user);
	}

	/**
	 * {@inheritDoc}
	 */
	public int update(User user) {
		return update(namespace + ".update", user);
	}

	/**
	 * {@inheritDoc}
	 */
	public User queryUser(Long uid) {
		return queryForObjectByID(namespace + ".queryUserById", uid);
	}

	/**
	 * {@inheritDoc}
	 */
	public int delete(Long uid) {
		return deleteById(namespace + ".deleteById", uid);
	}
	
}
